File transfer protocol is a system wherein files can be pulled from a remote site to a user's personal account, or sent to another account, possibly on a different machine. This system works in a similar way to conventional modem upload / downloading, albeit on a much larger scale, and at a much faster speed.
2. Accessing FTP.
Most schools will have a copy of FTP software available on any machine connected to the Internet network. Connection to the internet is a requirement to use FTP directly. Users only connected to the BITNET network can not use direct FTP, but can make use of the BITFTP server at PUCC.BITNET. More information is avaialable by sending the command HELP to BITFTP at PUCC, by either interactive messaging, or electronic mail.
3. Starting up FTP.
The command to engage FTP on most systems is:
FTP (site id)
where the site id is the Internet Address of the site you wish to connect to. This site id functions the same way as a Telephone number when dialing the phone, i.e. it indicates exactly which machine you wish to contact. The site address can be in one of two forms, domain-name or numeric.
Domain-name addresses are represented in a form similar to 'sumex-aim.stanford.edu'. This format will only work if your system has this domain address on file, or if it is equipped with a nameserver program, which can gather necessary information from other sources.
The domain-name address is translated by your machine (either by the nameserver, or data already in files) into a numeric address. This numeric address corresponds to the physical location of the target machine on the Internet. The numeric address conversion of sumex-aim.stanford.edu is 36.44.0.6.
If your FTP command will not accept a site id, see the OPEN command, in the next section.
4. Connecting to the remote site, and accessing accounts.
After issuing the FTP command, the computer will make the necessary connections among machines and will respond once a successful connection is made with a message like:
Connected to Sumex-Aim.Stanford.Edu (36.44.0.6) Sun OS 4.0
If the connection can not be made, your machine will indicate the reason. In this case you can either try again later, or attempt to connect to a different machine.
Once into the FTP program, the command to connect to a site is OPEN (SiteId). This command functions exactly the same as if you were connecting with the FTP command above.
After the connection has been established, the target machine will prompt you for the account you wish to connect. Many sites maintain a public access facility, under the account name 'anonymous' (Don't use the ' when entering the account i.d.).
Once the account name is accepted, the system may prompt you for a password. If you are accessing a private account, you will need the specific password for that account. For anonymous sites, the standard format is to use your userid@your machine.
5. Maneuvering within FTP
Once a successful connection has been made, you will be able to move around within the target machine's file structure. Two important commands for doing this are
DIR (Directory) - List files in the specified directory. If no directory is given, list files in the current directory.
CD (Directory) - Move into the specified directory. If .. is specified, move back into the previous directory.
For more information about directories, consult a basic UNIX Primer of your choice. (Author's Note: Most FTP sites are on UNIX systems, however, there are some on VM/CMS, VAX, or other systems, and the directory structure may vary. For more information, consult a manual for the appropriate system. The remainder of this document will assume connection to a UNIX or UNIX emulating system.)
Most systems supporting an anonymous site store information in a pub directory. Use CD PUB to move into this directory.
6. Transferring Files
Once you have located the file or files you wish to transfer, you can use one of four commands to move them. These commands are GET, MGET, PUT, and MPUT. They are used as follows:
GET - retrieve a single file from the target machine. The format is GET (Filename).
MGET - retrieve mutiple files from the target machine using wildcards (see below). Depending on the system, you may be prompted individually to confirm transfer of each file. The format is MGET (fileid).
PUT - send a single file to the target site. The format is PUT (filename).
MPUT - send multiple files to the target machine using wildcards. Depending on the system, you may be prompted to confirm transfer of individual files. The format is MPUT (fileid).
File Types - Sometimes files need to be transferred in a specific format, such as Binary, or Ascii. Most systems use ascii by default. If you need to use a specific file type, such as BINARY for a GIF file, type the desired filetype as a separate command before initiating the transfer.
Wildcards - Most FTP sites accept wildcards similar to those used in UNIX, and MS-DOS. The most commonly used wildcard is *, which means match anything before the *. For example, using the wildcard Mar* would match files named March, Martian, Mars, etc. This wildcard would not, however, match a file named Fred.
Note - Many FTP sites are case sensitive. The file 'MARCH' can be totally different from the file 'March'. Be careful.
7. Ending the session.
Once you have transferred all the files you have desired, it is time to disconnect from the target site. There are two commands you can use, CLOSE and QUIT.
CLOSE will end the connection to the current site, but leave you in the FTP program, where you can then issue an OPEN command to connect to a new system.
QUIT will end the connection and return you to your operating system.
APPENDICES
Appendix A - Manual Identification.
Some FTP systems do not automatically prompt users for their identification and password. In this case, there are two commands that are used to provide the target machine with the necessary information:
USER (accountId) - Identifies the account with which you wish to connect on the target machine. To connect to an anonymous site, the command would be USER anonymous.
PASS (Password) - Submits the password for the target account to the target machine. This command can often also be used to resubmit a password originally typed incorrectly.
Appendix B - A Sample (Generic) FTP Session
This is a transcript of a very generic FTP session. Messages displayed will vary from system to system, but should look generally like the example below. Text encased in (**) indicates comments and are not a part of the FTP session. Input from the User is in bold type. System output is in normal type.
bigboy> FTP 36.44.0.6
Connected to 36.44.0.6
250 Welcome to Sumex-Aim.Stanford.Edu - Sun OS 4.0
ftp> cd info-mac
250 Directory changed succesfully
ftp> dir
250 Opening connection for bin/dir (129.32.1.21,1333)
drwxr--r-- ftp wheel app/
(*Rest of directory omitted. The d at the front of the data line signifies a directory that can be moved into*)
ftp> cd app
250 Directory changed successfully
ftp> get NetDoc.Project.Hqx
Opening Connection for NetDoc.Project.Hqx (79332 bytes)
Transferring NetDoc.Project.Hqx
Transfer Completed - 79332 bytes transferred.
ftp> quit
Connection closed.
bigboy>
Appendix C - Additional Commands
There are some additional commands that may be of use while working with FTP:
Hash - When the Hash command is implemented, the FTP system will display a # sign every 1K (8K on some systems) of material transferred. This is useful in confirming data transfer and estimating speed. This command will not work on VM/CMS systems which automatically update this information.
Mode B - Set block transfer. Along with Type E, the two commands are used when transferring VM/CMS modules.
Help - This command is self-explanatory. Specific formats of the command may vary from system to system.
Appendix D - System Etiquette
When using FTP, please remember that FTP is only a small part of a much larger network system, and that there are certain codes that should be followed.
To reduce load on the network, it is best not to use FTP during peak times (9 am - 5 pm in the country of operation). If use is necessary, try to complete transactions as speedily as possible. Anonymous sites are often supported by institutions that have other responsibilities. You should not connect to anonymous sites during prime-time.